<!DOCTYPE html>
<html lang="zh">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        html,
        body {
            margin: 0;
            padding: 0;
            width: 100%;
            height: 100%;
        }

        .container {
            background-color: #414141;
            font-size: 20px;
            display: flex;
            flex-direction: row;
        }
        .main {
            background-color: #7ec0e4;
            flex-grow: 1;
        }

        .sidebar {
            background-color: #ffff9d;
            display: flex;
            flex-direction: column;
            flex-basis: 150px;
        }
    </style>
</head>

<body class="container">
    <div class="main">.main
            <b>菜单栏固定,内容区动态变化宽度</b>
    </div>
    <div class="sidebar">
        .sidebar
    </div>
</body>

</html>